import Network from "@/api/network";

/**
 * 添加用户
 * @param data
 * @returns {Promise | Promise<unknown>}
 */
export const addUser= (data) => Network.post('/mall-sys-user/save', data);

/**
 * 查询用户
 * @param data
 * @returns {Promise | Promise<unknown>}
 */
export const queryUser= (data) => Network.post('/mall-sys-user/queryPage', data);

/**
 * 更新用户状态
 * @param data
 * @returns {Promise | Promise<unknown>}
 */
export const updateStatusUser= (data) => Network.put('/mall-sys-user/state', data);


/**
 * 查看所有角色
 * @param data
 * @returns {Promise | Promise<unknown>}
 */
export const getRoleAll= (data) => Network.get('/mall-sys-role/queryAll', data);

/**
 * 为用户添加角色
 * @param data
 * @returns {Promise | Promise<unknown>}
 */
export const addUserRole= (data) => Network.post('/mall-sys-user/save', data);

/**
 * 为用户添加角色
 * @param data
 * @returns {Promise | Promise<unknown>}
 */
export const getByUserId= (data) => Network.get('/mall-sys-user/getById', data);

/**
 * 删除用户
 * @param data
 * @returns {Promise | Promise<unknown>}
 */
export const removeUserId= (data) => Network.delete('/mall-sys-user/del', data);

/**
 * 个人中心
 * @param data
 * @returns {Promise | Promise<unknown>}
 */
export const getUserInfo= (data) => Network.get('/mall-sys-user/getByIdThis', data);

/**
 * 更新用户
 * @param data
 * @returns {Promise<unknown>}
 */
export const uploadAvatar=(data) => Network.post('/mall-sys-user/uploadAvatar',data);
